<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>编辑菜单</title>
  <link rel="stylesheet" th:href="@{/layui-v2.6.8/css/layui.css}" href="/static/layui-v2.6.8/css/layui.css">
</head>
<body>
<div style="padding: 15px;">
  <div>
    <a th:href="@{/menu/getMenuList}">
      <i class="layui-icon layui-icon-return" style="font-size: 30px; color: #1E9FFF;"></i>
    </a>
  </div>
  <form class="layui-form form-position" action="/amin/menu/editMenu" method="post">
    <input type="text" name="id" th:field="${menu.id}" style="display: none;">
<!--
    <input type="text" name="menuId" th:field="${menu.menuId}" style="display: none;">
-->
    <div class="layui-form-item">
      <label class="layui-form-label">菜单名称</label>
      <div class="layui-input-block">
        <input type="text" name="menuName" th:field="${menu.menuName}" required  lay-verify="required" placeholder="请输入菜单名称" autocomplete="off" class="layui-input layui-input-width">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">上级菜单</label>
      <div class="layui-input-block">
        <select name="parentId" lay-filter="aihao" th:field="${menu.parentId}">
          <option th:each="menuList:${menuList}" th:value="${menuList.id}" th:text="${menuList.menuName}">本站</option>
        </select>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">菜单链接</label>
      <div class="layui-input-block">
        <input type="text" name="menuHref" th:field="${menu.menuHref}" required  lay-verify="required" placeholder="请输入菜单链接" autocomplete="off" class="layui-input layui-input-width">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">跳转方式</label>
      <div class="layui-input-block">
        <select name="jumpMode" lay-filter="aihao" th:field="${menu.jumpMode}" >
          <option value="0" selected="">本站</option>
          <option value="1">外站</option>
        </select>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">菜单类型</label>
      <div class="layui-input-block">
        <select name="menuType" lay-filter="aihao"  th:field="${menu.menuType}" >
          <option value="0" selected="">菜单</option>
          <option value="1">按钮</option>
        </select>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">打开方式</label>
      <div class="layui-input-block">
        <select name="openType" lay-filter="aihao" th:field="${menu.openType}" >
          <option value="home-page" selected="">站内</option>
          <option value="1">网页</option>
        </select>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">菜单序号</label>
      <div class="layui-input-block">
        <input type="text" name="sort" th:field="${menu.sort}" required  lay-verify="required" placeholder="请输入菜单序号" autocomplete="off" class="layui-input layui-input-width">
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" lay-submit lay-filter="formDemo">保存</button>
<!--
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
-->
      </div>
    </div>

  </form>
</div>
</body>
<!-- 引入 layui.js -->
<script th:src="@{/layui-v2.6.8/layui.js}" src="/static/layui-v2.6.8/layui.js"></script>
<script>
  layui.use(function(){
    var layer = layui.layer
            ,form = layui.form;
    //layer.msg('Hello World');
    //监听提交
    form.on('submit(formDemo)', function(data){
      //layer.msg(JSON.stringify(data.field));
      return true;
    });
  });
</script>
</html>